package org.soria.getinfo.utils;

import javax.swing.*;
import javax.swing.border.CompoundBorder;
import javax.swing.border.EmptyBorder;
import javax.swing.border.TitledBorder;

public class PanelUtil {
    public static CompoundBorder createBorder(String title) {
        TitledBorder titledBorder = new TitledBorder(title);
        titledBorder.setTitleFont(FontUtil.TITLE);
        titledBorder.setBorder(new EmptyBorder(1, 1, 1, 1));
        return new CompoundBorder(titledBorder, BorderFactory.createLoweredBevelBorder());
    }

    public static JLabel createLabel(String key, int x, int y){
        JLabel label = new JLabel(key);
        label.setBounds(x, y, 110, 20);
        label.setFont(FontUtil.DEFAULT);
        return label;
    }

    public static JLabel createInfoLabel(String info, int x, int y, int width){
        JLabel textLabel = new JLabel(info);
        textLabel.setBounds(x, y, width, 20);
        return textLabel;
    }
}
